<template>
	<view class="app">
		<view class="price-box">
			<text>支付金额</text>
			<text class="price">{{price}}</text>
			<text class="toPay" @click="goPayClick">立即支付</text>
		</view>
		<view class="content">
			<!--:money：支付金额  show：是否显示 @cancel:取消  @success：确认支付 -->
			<cc-payDialog :money="money" :show="payVisible" @cancel="cancelPayHandle"
				@success="successPayHandle"></cc-payDialog>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				price: 0,
				payVisible: false,
				money: 0,
			}
		},
		onLoad(option) {
			this.price = option.allPrice
			this.money = option.allPrice
			uni.setNavigationBarTitle({
				title: '支付'
			})
		},
		methods: {
			toPay() {

			},
			goPayClick() {
				this.payVisible = true;
			},
			successPayHandle: function() {
				this.payVisible = false;
				uni.navigateTo({
					url:'/pages/paySuccess/paySuccess'
				})
			},
			cancelPayHandle: function() {
				this.payVisible = false;
			},

		}
	}
</script>

<style lang="scss">
	.app {
		width: 100%;
		background-color: #fff;
		height: 100vh;
	}

	.price-box {
		height: 1000rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		color: #909399;

		.price {
			font-size: 50rpx;
			color: #303133;
			margin-top: 12rpx;

			&:before {
				content: '￥';
				font-size: 40rpx;
			}
		}

		.toPay {
			margin-top: 300rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 600rpx;
			height: 80rpx;
			font-size: 32rpx;
			color: #fff;
			background-color: #fa436a;
			border-radius: 10rpx;

			&.hollow {
				background: #fff;
				color: #303133;
				border: 1px solid #ccc;
			}
		}
	}

	.content {
		display: flex;
		flex-direction: column;
	}
</style>